#@head() #@header()
<title>客户列表</title>
#@aside("user")
<script type="text/javascript" src="#(path)/assets/js/jquery.tmpl.min.js"></script>
<style>
	.box-body{padding:5px !important}
</style>
<div class="content-wrapper">
	<section class="content">
	<div class="nav-tabs-custom">
		#@usermenu("smxx")
		<div class="tab-content"> 
		  <div class="tab-pane active" id="tab_1">
			<div class="box-body">
			<table id="example1" class="table table-bordered table-striped dataTable col-md-8" role="grid" aria-describedby="example1_info">
				<tbody>
				<tr role="row" class="even">
				  <td align="right" style="width:130px;" class="sorting_1">手机号码：</td>
				  <td id="mobile" class="sorting_1"></td>
				</tr>
				<tr role="row" class="odd">
				  <td align="right" style="width:130px;" class="sorting_1">实名时间：</td>
				  <td id="real_name_time" class="sorting_1"></td>
				</tr>
				<tr role="row" class="odd">
				  <td align="right" style="width:130px;" class="sorting_1">真实姓名：</td>
				  <td id="real_name" class="sorting_1"></td>
				</tr>
				<tr role="row" class="even">
				  <td align="right" style="width:130px;" class="sorting_1">身份证号：</td>
				  <td id="cert_num" class="sorting_1"></td>
				</tr>
				<tr role="row" class="odd">
				  <td align="right" style="width:130px;" class="sorting_1">性别：</td>
				  <td id="sex" class="sorting_1"></td>
				</tr>
				<tr role="row" class="odd">
				  <td align="right" style="width:130px;" class="sorting_1">生日：</td>
				  <td class="sorting_1">
					<span id="birthday"></span>
					<select id="birth" style="width:80px;height:30px;" >
						<option value="1">农历</option>
						<option value="0">阳历</option>
					</select>
					<button id="change" type="button" class="btn btn-info btn-flat">修改</button>
				</td>
				</tr>
				</tbody>
			</table>
			</div>
		</div>
	</div>
	</section> 
</div>
#@footer()
<script>
$(document).ready(function(){
	 
	$.getJSON("/user/fullInfo?token=#(session.token??)&id="+id.id, function(userinfo) {
		 console.log(userinfo);
		setFormVals(userinfo.data.info);
		$("#sex").html(userinfo.data.info.sex==1 ? "男" : "女");
		$("#birth").val(userinfo.data.info.is_lunar_calendar);
		$("#change").click(function(){
			var birth1 = $("#birth").val();
			$.getJSON("#(path)/user/modifyInfo?token=#(session.token??)&id="+id.id+"&isLunarCalendar="+birth1, function(userinfo) {
				if(userinfo.code=='success'){
					layer.msg(userinfo.msg, {time: 1000, icon:1},function(){
						window.location.href="#(path)/admin/page/user-realinfo?id="+id.id;
					});
				}else if(userinfo.code=='error'){
					layer.msg(userinfo.msg, {icon:2},function(){
						// 登陆失败，提醒错误...
					});
				}
			});
		});
		
		
	});
	//菜单
	
});
</script>
</body>
</html>